How to get a nested json result after grouping a list

join shbcf.ru